import Vue from 'vue'
import Router from 'vue-router'
import Login from '@/components/Login'
import Home from '@/components/Home'
import Book from '@/components/Book'
import BookMana from '@/components/BookMana'
import Cart from '@/components/Cart'
import Order from '@/components/Order'
import Register from '@/components/Register'

Vue.use(Router)

export default new Router({
  mode:'hash',
  routes: [
    {
      path: '/',
      name: '登录',
      hidden: true,
      component: Login
    },{
        path: '/register',
        name: '注册',
        hidden: true,
        component: Register
    }, {
      path: '/home',
      name: '',
      component: Home,
      hidden: true
    }, {
      path: '/home',
      component: Home,
      name: '书籍展示',
      hidden: false,
      children: [
        {
          path: '/book',
          iconCls: 'fa fa-user-o',
          name: '书籍展示',
          component: Book,
        }
      ]
    }, {
        path: '/home',
        component: Home,
        name: '书籍管理',
        iconCls: 'fa fa-bar-chart',
        hidden: true,
        children: [
          {
            path: '/bookMana',
            iconCls: 'fa fa-bar-chart',
            name: '书籍管理',
            component: BookMana
          }
        ]
    }, {
        path: '/home',
        component: Home,
        name: '购物车',
        iconCls: 'fa fa-bar-chart',
        hidden: false,
        children: [
            {
                path: '/cart',
                iconCls: 'fa fa-bar-chart',
                name: '购物车',
                component: Cart
            }
        ]
    }, {
        path: '/home',
        component: Home,
        name: '我的订单',
        iconCls: 'fa fa-reorder',
        hidden: false,
        children: [
            {
                path: '/order',
                iconCls: 'fa fa-reorder',
                name: '我的订单',
                component: Order
            }
        ]
    }
  ]
})
